import java.sql.SQLOutput;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        int[] array = {1,2,3,4,5};
        int[] array2 = new int[]{1,2,3,4,5};
        int[] array3 = new int[5];

        char[] chars ={'a','b','c'};

        System.out.println(chars.length);

        boolean[] array5 = new boolean[10];//里面默认放的是false
        System.out.println(array5[1]);
    }
    public static int fac(int n) {
        if(n == 1) {
            return 1;
        }
        int tmp = n * fac(n-1);
        return tmp;
    }
    public static int fib(int n) {
        if(n == 1 || n ==2) {
            return 1;
        }
        int f1 = 1;
        int f2 = 1;
        int f3 = 1;
        for(int i = 3; i <= n;i++) {
            f3= f1+f2;
            f1 = f2;
            f2 = f3;
        }
        return f3;
    }
    public static void main5(String[] args) {
        System.out.println(fib(5));
    }
    public static int max(int a ,int b) {
        return a>b?a:b;
    }
    public static int max(int a,int b,int c) {
        int maxNum = max(a,b);
        int ret = max(c,maxNum);
        return ret;
    }
    public static void main4(String[] args) {
        int count = 3;
        Scanner scanner = new Scanner(System.in);
        while (count != 0) {
            System.out.println("请输入你的密码");
            String passWord = scanner.nextLine();
            if(passWord.equals("123456")) {
                System.out.println("登录成功了");
                return;
            }else {
                count--;
                System.out.println("你还有 "+ count +"次机会！");
            }
        }
    }
    public static void main3(String[] args) {
        int n = 123;
        while (n != 0) {
            System.out.println(n%10);
            n /=10;
        }
    }
    public static void main2(String[] args) {
        double sum = 0;
        int ret = 1;
        for (int i = 1; i <= 100; i++) {
            sum += 1.0/i * ret;
            ret = -ret;
        }
        System.out.println(sum);
    }
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        //注意hasNext 和 hasNextLine 的区别
        while(in.hasNextLine()) {
            int n = in.nextInt();
            for(int i = 0;i < n; i++) {
                for(int j = 0; j < n; j++) {
                    if(i == j || i +j == n-1) {
                        System.out.print("*");
                    }else {
                        System.out.print(" ");
                    }
                }
                System.out.println();
            }
        }
    }
}
